package com.huawei.translate.vo.translate;

import org.apache.commons.lang3.StringUtils;

import java.util.List;

public class TranslateArrayRequest extends TranslateBaseRequest {

    private List<String> texts;

    public TranslateArrayRequest() {
    }

    public TranslateArrayRequest(String accessToken, String from, String to, List<String> texts) {
        setAccessToken(accessToken);
        setFrom(from);
        setTo(to);
        this.texts = texts;
    }

    public List<String> getTexts() {
        return texts;
    }

    public void setTexts(List<String> texts) {
        this.texts = texts;
    }

    public boolean isValid() {
        if (StringUtils.isEmpty(getAccessToken()) || StringUtils.isEmpty(getFrom()) || StringUtils.isEmpty(getTo()) || texts == null || texts.size() < 1) {
            return false;
        }
        return true;
    }
}
